package com.itlong.cloud.project.sdk;

import com.itlong.cloud.POJO.DTO.sdk.QrcodeSDKGetPassRecordDTO;
import com.itlong.cloud.POJO.VO.sdk.QrcodeSDKGetPassRecordVO;
import com.itlong.cloud.utils.page.Page;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.io.IOException;
import java.security.NoSuchProviderException;
import java.util.Map;

/**
 * <desc>
 *      二维码SDK 业务处理暴露接口
 * </desc>
 *
 * @createDate 2018/05/24
 */
@FeignClient(name = "project-service")
public interface IQrCodeSDKServiceClient {
    /**
     * <desc>
     *      生成二维码
     * </desc>
     *
     * @param qrCode 二维码所需数据json字符串
     * @return
     * @author Jiaqi.X
     * @createDate 2018/05/24
     */
    @PostMapping(path = "/sdkServer/qrCode/secretQrCodeStr")
    Map<String,Object> secretQrCodeStr(@RequestParam("qrCode") String qrCode) throws Exception;

    /**
     * <desc>
     *      生成新版sdk二维码
     * </desc>
     *
     * @param qrCode
     * @return
     * @author Jiaqi.X
     * @createDate 2019/10/28
     */
    @PostMapping(path = "/sdkServer/qrCode/secretNewQrCodeStr")
    Map<String,Object> secretNewQrCodeStr(@RequestParam("qrCode") String qrCode) throws IOException, NoSuchProviderException;

    /**
     * <desc>
     *      身份校验
     * </desc>
     *
     * @param appId
     * @param appsecret
     * @param projectId
     * @return
     * @author Jiaqi.X
     * @createDate 2018/10/15
     */
    @PostMapping(path = "/sdkServer/qrCode/checkRequestIdentity")
    Integer checkRequestIdentity(@RequestParam("appid") String appId,
                                 @RequestParam("appsecret") String appsecret,
                                 @RequestParam("projectId") String projectId);

    /**
     * <desc>
     *      获取分页数据
     * </desc>
     *
     * @param pageDTO   参数DTO
     * @return
     * @author Jiaqi.X
     * @createDate 2019/06/30
     */
    @PostMapping(path = "/sdkServer/qrCode/getPage")
    Page<QrcodeSDKGetPassRecordVO> getPage(@RequestBody QrcodeSDKGetPassRecordDTO pageDTO) throws Exception;
}
